/* Ali
 * Adobis's Mission I: The Room of Tragedy (280090000)
 * Zakum Quest NPC Exit
*/

void npc(Player @player, NPC @npc) {
    int state = npc.getState();
    if(state == 0){
		npc.addText("See you next time."); 
		npc.sendNext();
	}
	else if(state == 1){
		player.changeMap(211042300);
		if(player.getItemAmount(4001015) > 0){
			player.giveItem(4001015, -player.getItemAmount(4001015));
		}
		else if(player.getItemAmount(4001016) > 0){
			player.giveItem(4001016, -player.getItemAmount(4001016));
		}
		else if(player.getItemAmount(4001018) > 0){
			player.giveItem(4001018, -player.getItemAmount(4001018));
		}
		npc.end();
	}
}